package com.platform.user.controller;

import com.platform.bean.Result;
import com.platform.user.entity.ItemClazz;
import com.platform.user.service.ItemClassService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/itemClass")
public class ItemClassController {

    @Resource
    private ItemClassService itemClassService;

    @PostMapping("queryAllItemClass")
    // 可优化：缓存进行查询
    public Result<Map<String, Object>> queryAllItemClass(@RequestBody Map<String, Object> params) {
        List<ItemClazz> itemClazzList = itemClassService.queryAllItemClazz();
        return Result.ok(itemClazzList);
    }
}
